clear
set more off
capture log close

*Please replace this with the appropriate destination*
cd "/Users/christineliu/Desktop/Japan Paper/"


use IVs and DVs.dta, replace


log using Results.log, replace


************
*Declaring time-series*
tsset t

*Figure 1.*
*The two panel graphs were adjusted from 2 columns to 2 rows under 'Graph properties'>'Organization'*
tsset Month
graph twoway tsline Vessels, tlabel(2010m9 2014m9 2018m9) ytitle("Vessel Entries") title("Vessel Entries Within the Territorial Sea")
graph rename t1
graph twoway tsline patrol,  tlabel(2010m9 2014m9 2018m9) ytitle("Vessel Patrols") title("Vessel Patrols Within the Territorial Sea")
graph rename t2 
graph combine t1 t2


*Logit regressions*

*Table 1.*
*Need to install asdoc to export table into word*
ssc install asdoc, replace
asdoc logistic actspe1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest replace eform
asdoc logistic actgen1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetact Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetpas Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform


*Table 2.*
asdoc logistic actspe1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp Hato Kan Noda Abe JPCHtrade GDPQgr toffice election, nest replace eform
asdoc logistic actgen1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp Hato Kan Noda Abe JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetact Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp Hato Kan Noda Abe JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetpas Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp Hato Kan Noda Abe JPCHtrade GDPQgr toffice election, nest eform


*Figure 2.*
*The position and size of the labels were lightly adjusted using the 'graph editor' function*
logistic actspe1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election
margins, at (Lagvessels=(0(5)30))
marginsplot, ytitle("Probability of Specific Policy Rhetoric") xtitle("Vessel Intrusion per month") title("Marginal Effects of Vessel Intrusion on Specific Policy Rhetoric")

*marginal effects at the mean*
margins, at (Lagvessels=(6.5(.5)7.5)) atmeans post


*Figure 3.*
asdoc logistic rhetact Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election
margins, dydx(LagApp) at (govstr1=(60(5)100))
marginsplot, ytitle("Effect of Approval Rating on International Attitude Rhetoric") xtitle("Government Strength") title("Marginal Effect of Approval Rating Moderated by Government Strength")

*Figure 4.*
asdoc logistic rhetact Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election
margins, dydx(govstr1) at (LagApp=(10(5)70))
marginsplot, ytitle("Effect of Government Strength on International Attitude Rhetoric") xtitle("Approval Rating") title("Marginal Effect of Government Strength Moderated by Approval Rating")

 
*Appendix*
*Table A6.*
asdoc sum rhetpas rhetact actgen1 actspe1 Lagvessels dscrq Missiles dCR LagApp dunemp govstr1 govstr1App Aso Hato Kan Noda Abe partyid JPUStrade JPCHtrade toffice election GDPQgr dRUscrq dCHscrq patrol altvessels, replace

*Table A7.*
asdoc logistic actspe1 Lagpatrol dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest replace eform
asdoc logistic actgen1 Lagpatrol dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetact Lagpatrol dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetpas Lagpatrol dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform

*Table A8.*
asdoc logistic actspe1 altvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest replace eform
asdoc logistic actgen1 altvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetact altvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetpas altvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform

*Table A9.*
asdoc logistic actspe1 Lagvessels dRUscrq dCHscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest replace eform
asdoc logistic actgen1 Lagvessels dRUscrq dCHscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetact Lagvessels dRUscrq dCHscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform
asdoc logistic rhetpas Lagvessels dRUscrq dCHscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest eform

*Table A10.*
asdoc reg actspe1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest replace
asdoc reg actgen1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest
asdoc reg rhetact Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest
asdoc reg rhetpas Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPCHtrade GDPQgr toffice election, nest

*Table A11.*
asdoc reg actspe1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp Hato Kan Noda Abe  JPCHtrade GDPQgr toffice election, nest replace
asdoc reg actgen1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp Hato Kan Noda Abe  JPCHtrade GDPQgr toffice election, nest
asdoc reg rhetact Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp Hato Kan Noda Abe  JPCHtrade GDPQgr toffice election, nest
asdoc reg rhetpas Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp Hato Kan Noda Abe  JPCHtrade GDPQgr toffice election, nest
 
*Table A12.*
asdoc logistic actspe1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPUStrade GDPQgr toffice election, nest replace eform
asdoc logistic actgen1 Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPUStrade GDPQgr toffice election, nest eform
asdoc logistic rhetact Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPUStrade GDPQgr toffice election, nest eform
asdoc logistic rhetpas Lagvessels dscrq Missiles dCR govstr1App govstr1 LagApp dunemp partyid JPUStrade GDPQgr toffice election, nest eform



sum


log close
